#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# constellations = ("摩羯", "水瓶", "双鱼", "白羊", "金牛", "双子", "巨蟹", "狮子", "处女", "天秤", "天蝎", "射手", "摩羯")
   
# def get_constellation(month, date):
#     dates = (21, 20, 21, 21, 22, 22, 23, 24, 24, 24, 23, 22)
#      if date < dates[month-1]:
#         return constellations[month-1]
#     else:
#         return constellations[month]

chinese_zodiacs = '鼠牛虎兔龙蛇马羊猴鸡狗猪'

def get_chinese_zodiac(year):
    i = (8 + year)%12
    return chinese_zodiacs[i]

# print(get_chinese_zodiac(2000))
# 列表
zodiacs = ['摩羯座','水瓶座','双鱼座','白羊座','金牛座','双子座',
    '巨蟹座','狮子座','处女座','天秤座','天蝎座','射手座']
dates = [(1,20),(2,19),(3,21),(4,21),(5,21),(6,22),
    (7,23),(8,23),(9,23),(10,23),(11,23),(12,22)]

def get_zodiac(month, day):
    for d, z in zip(dates, zodiacs):
        if (month, day) < d:
            return z
    return zodiacs[0]

# print(get_zodiac(10, 15))


# dct = {}
# for z, d, d1 in zip(zodiacs, dates, (dates[-1],) + dates[:-1]):

#     begin = d1[0] - 1, d1[1]
#     end = d[0], d[1] - 1
#     dct[z] = ('%d.%d - ' % begin + '%d.%d' % end)

# print(dct)

constellation_dict = {'摩羯座': '11.22 - 1.19', 
'水瓶座': '0.20 - 2.18', '双鱼座': 
'1.19 - 3.20', '白羊座': '2.21 - 4.20', '金牛座': '3.21 - 5.20', '双子座': '4.21 - 6.21', '巨蟹座': '5.22 - 7.22', '狮子座': '6.23 - 8.22', '处女座': '7.23 - 9.22', '天秤座': '8.23 - 10.22', '天蝎座': '9.23 - 11.22', '射手座': '10.23 - 12.21'}
